import java.util.Scanner;

public class NGuessNumber {
    Scanner sc = new Scanner(System.in);
    int[] answers = new int[4];
    int[] guesses = new int[4];

    public int[] generateAnswer() {
        answers[0] = (int) (Math.random() * 100 + 1);
        int i = 1;
        while (i < 4) {
            int answer = (int) (Math.random() * 100 + 1);
            boolean same = false;
            int j = 0;
            while (j < i) {
                if (answer == answers[j]) {
                    same = true;
                    break;
                }
                j = j + 1;
            }
            if (!same) {
                answers[j] = answer;
                i = i + 1;
            }
        }
        return answers;
    }

    public void recGuessNumber() {
        int i = 0;
        while (i < 4) {
            try {
                guesses[i] = sc.nextInt( );
                i = i + 1;
            } catch (Exception e) {
                sc.next();
                System.out.println("请重新输入");
                continue;

            }
        }

    }
    public void compare(){
            int a = 0;
            int b= 0;
        for (int i = 0; i < 4; i++) {
            if (answers[i]==guesses[i]){
                a=a+1;
            }
        }
        for (int i = 0; i <4 ; i++) {
            for (int j = 0; j <4 ; j++) {
                if (j!=i &&answers[i]==guesses[i]){
                    b=b+1;
                }
            }
        }
        System.out.println(a+"A"+b+"B");
    }

    public static void main(String[] args) {
        NGuessNumber ngn = new NGuessNumber();
        int[] answers = ngn.generateAnswer();
        for (int i = 0; i < answers.length; i++) {
            System.out.println(answers[i]);
        }
        ngn.recGuessNumber();
    }
}